home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9092 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  671 b 

  1. Path: news-m01.ny.us.ibm.net!usenet
  2. From: bbogard@ibm.net
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Simple inheritance Q
  5. Date: 28 Feb 1996 16:37:05 GMT
  6. Message-ID: <4h20bh$154o@news-s01.ny.us.ibm.net>
  7. References: <4gumo0$hta@netlab.cs.rpi.edu>
  8. Reply-To: bbogard@ibm.net
  9. NNTP-Posting-Host: slip37-223-98.ibm.net
  10. X-Newsreader: IBM NewsReader/2 v1.2.5
  11.  
  12. >then I get the error in line 3:
  13. >  Can not convert Cat * to Animal *
  14. >
  15. >But if I define
  16. >   class Cat:public Animal{...
  17. >
  18. >everything is fine.
  19. >
  20. >Can anyone tell me why?
  21. you must inherit publically in order for cat to see animals constructor.  If cat can't see animal's
  22. constructor, you will get the error you are getting.
  23.